<h1>Tạo phương thức thanh toán mới</h1>

<?php echo $this->Form->create('PaymentType', array('action' => 'add')); ?>
<table class="table2">
    <tr>
        <td>Phương thức thanh toán <span class="compulsory">*</span></td>
        <td>
            <p class="pb5"><input class="textfield" name="data[][PaymentType][name]" type="text" /> &nbsp;<a href="javascript:" class="underline" onclick="$(this).parent().parent().parent().remove();">Xóa</a></p>
        </td>
    </tr>
    <tr>
        <td></td>
        <td>
            <a href="javascript:" class="underline" id="add-more">Thêm</a>
        </td>
    </tr>
    <script type="text/javascript">
    $(document).ready(function() {
        $('#add-more').click(function(){
           $(this).parent().parent().before('<tr><td>Phương thức thanh toán <span class="compulsory">*</span></td><td><p class="pb5"><input class="textfield" name="data[][PaymentType][name]" type="text" /> &nbsp;<a href="javascript:" class="underline" onclick="$(this).parent().parent().parent().remove();">Xóa</a></p></td></tr>');
        });
    });
    </script>
    <tr>
        <td>&nbsp;</td>
        <td>
            <?php echo $this->Form->submit('Tạo mới', array('class' => 'button', 'div' => false)); ?>
            <?php echo $this->Form->submit('Hủy', array('class' => 'button', 'onclick' => "return back_to_index()", 'div' => false)); ?>
            <script type="text/javascript">
            function back_to_index()
            {
                window.location = '<?php echo $this->Html->url(array('controller' => 'payment_types', 'action' => 'index')) ?>';
                return false;
            }
            </script>
        </td>
    </tr>
</table>
<?php echo $this->Form->end(); ?>